package com.hspedu.homework.homework13;

public class Teacher extends Person{
    private int work_age;

    @Override
    public void printInfo() {
        System.out.println("老师的信息:");
        super.printInfo();
        System.out.println("工龄:"+this.work_age);
    }

    @Override
    public void play() {
        super.play();
        System.out.println("爱玩象棋..");
    }

    public void  teach(){
        System.out.println("我承诺，我会认真教学！");
    }

    public Teacher(String name, String sex, int age, int work_age) {
        super(name, sex, age);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }
}
